package com.read.mapper;

import com.read.dto.params.RegisterParamsDto;
import com.read.dto.result.JwtUserDto;
import com.read.entity.User;
import org.apache.ibatis.annotations.Param;

public interface UserMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(User record);

    int insertSelective(User record);

    User selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(User record);

    int updateByPrimaryKey(User record);

    /**
     * @description 注册用户
     * @author sh-sunb6
     * @date 2019-02-21 10:45
     */
    public int registerUser(RegisterParamsDto paramsDto);

    /**
     * @description 根据用户名查询用户数量
     * @author sh-sunb6
     * @date 2019-02-21 13:33
     */
    public int selectUserCountByUserName(String userName);

    /**
     * @description 登陆
     * @author sh-sunb6
     * @date 2019-02-21 14:00
     */
    public JwtUserDto loginUser(@Param("account") String account, @Param("password") String password);

}